<?php
include "../../config/ini.php";

$return = "0";
$pathTempDir = DIRETORIO."files/temp/";

if(!is_dir($pathTempDir)){
	mkdir($pathTempDir, 0775);
}

if(!empty($_FILES)){
	$tempFile = $_FILES['Filedata']['tmp_name'];
	$nameFile = date("dmYHis")."##".$_FILES['Filedata']['name'];

	$targetFile =  $pathTempDir.$nameFile;
	
	if(move_uploaded_file($tempFile,$targetFile))
		$return =  $nameFile;
}

header('HTTP/1.1 200 OK');
header('Content-Type: text/html; charset=utf-8');

echo $nameFile;
?>